<%@ page language="java"  pageEncoding="utf-8"%>
<%@page import="com.ejoysoft.common.exception.NoRightException"%>
<%@page import="com.ejoysoft.wlanyz.business.Paper"%>
<%@page import="java.util.Vector"%>
<%@page import="com.ejoysoft.wlanyz.business.Ac"%>
<%@page import="com.ejoysoft.common.Constants"%>
 <%@ include file="../include/jsp/head.jsp"%>
<% 
if(!globa.userSession.hasRight("30005"))
      throw new NoRightException("用户不具备操作该功能模块的权限，请与系统管理员联系！");

    //初始化
    Paper latlng0=null;
    Paper obj=new Paper(globa);
    //查询条件
    String  classTwoACName=ParamUtil.getString(request,"classTwoACName","").trim(); 
	String tWhere=" WHERE 1=1";
	tWhere += " and acName='" + classTwoACName + "' and imgext=1";
	Vector<Paper> vctObj=obj.list11(tWhere,0,0); 
 	String paperId ="";
 	String acname = "";
 	int vctSize = 0;
 	String classTwoAcNameString ="";
    if(vctObj != null && vctObj.size()>0)
    {
    	 Paper objPaper0 = vctObj.get(0);
    	 paperId = objPaper0.getCadPic(); 
    	 acname= objPaper0.getAcName();
    	 vctSize = vctObj.size()+1;
    }
    System.out.println(paperId+"==="+acname);
    Ac objAc = new Ac(globa);
    Ac objAc2 = objAc.show(" where strId='"+classTwoACName+"'");
    if(objAc2 != null)
         classTwoAcNameString = objAc2.getClassTwoAC();
    String tempPaper= paperId;
    if(tempPaper!=null && tempPaper.length()>12)
		tempPaper = "..."+tempPaper.substring(tempPaper.length()-12,tempPaper.length()-4);	
	else if(tempPaper!=null && tempPaper.length()>4)
		tempPaper =tempPaper.substring(0,tempPaper.length()-4);	
%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>拓扑展现</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script type="text/javascript" src="../js/jquery-1.4.1.min.js"></script>
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--body
 {
	background-color: #FFFFFF; font-size:12px;
}
.sel1{ width:160px;}
.t2{font-size:14px; color:#000000}
.t1{font-size:12px;}
.t21 {font-size:14px; color:#000000}
.tab1{ width:123px; height:27px; background:url(../images/tab_1.jpg); color:#a94602; text-align:center; line-height:25px; font-weight:bolder}
.tab2{ width:123px; height:27px; background:url(../images/tab_2.jpg); color:#666666; text-align:center;line-height:25px;}
-->
</style> 
<script type="text/javascript">
function changePaper(paperId,acname){  
	$("#imageIframe").attr("src","mapedimage.jsp?acname2="+acname+"&paperId2="+paperId);
}
function fpBackUp(){

if(confirm("确认进行频点备份操作？"))
	window.location.href="fp_act.jsp?deviceid=<%=classTwoACName%>&<%=Constants.ACTION_TYPE%>=<%=Constants.BACK_STR%>";
}
function fpRestore(){
if(confirm("确认进行频点还原操作？"))
	window.location.href="fp_act.jsp?deviceid=<%=classTwoACName%>&<%=Constants.ACTION_TYPE%>=<%=Constants.RESTORE_STR%>";
}
function clkOn(num){ 
	var allNum = <%=vctSize%>;
	$("#tabLabel"+num).attr("class","tab1");
	for(i=1;i<allNum;i++)
	{
		if(i != num)
		{
			$("#tabLabel"+i).attr("class","tab2");
		} 
	}
}
</script>
</head>
 
<body>
<form action="fp_act.jsp" name=frm id=frm method="post">
<input type="hidden" name="acStrId" value="<%=classTwoACName%>" />
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><img src="../images/ri_list.jpg" width="14" height="14" align="absbottom" />&nbsp;您现在所在的位置：<font color="#0e7cc9">拓扑呈现</font> &gt;拓扑图展示 </td>
  </tr>
</table>
<br/>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="6%" class="listtit1"  style="border-left:1px solid #32a4ea;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>&nbsp;拓扑呈现</td>
        <td align="right" class="tdbm">
        <img src="../images/R01509-50.png" width="16" height="16" align="absmiddle" /> <a href="#">一键设置</a>&nbsp;
       <img src="../images/save_labled.png" width="16" height="16" align="absmiddle" /> <a href="#" onClick="fpBackUp()"> 频点备份</a>&nbsp;
      <img src="../images/1-11112R01455.png" width="16" height="16" align="absmiddle"/>   <a href="#"  onClick="fpRestore()" > 频点还原</a>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF" class="listd" style="border-left:1px solid #dddddd;border-right:1px solid #dddddd;padding: 0px;margin: 0px"> 
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%"><div align="center" style="border:0px"><iframe style="border:0px" id="imageIframe"  height="400" frameborder="0" marginheight="0" width="1100" marginwidth="0" scrolling="no" src="mapedimage.jsp?paperId2=<%=tempPaper%>&acname2=<%=acname%>&ramdo=<%=Math.random()%>"></iframe></div>
       </td>
      </tr> 
    </table>    
   </td>
  </tr> 
  <tr>  
     <td width="6%" class="listtit1"  style="border-left:1px solid #32a4ea;">
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr> 
   		<% 
   		if(vctObj != null && vctObj.size()>0)
   		{  
		   			String tempString1 = vctObj.get(0).getCadPic();
		   			if(tempString1!=null && tempString1.length()>12)
		   				tempString1 = "..."+tempString1.substring(tempString1.length()-12,tempString1.length()-4);	
		   			else if(tempString1!=null && tempString1.length()>4)
		   				tempString1 =tempString1.substring(0,tempString1.length()-4);	
   			%>
	   		  <td height="27" background="../images/tab_1.jpg" class="tab1" id="tabLabel1" onclick="clkOn('1');changePaper('<%=tempString1%>','<%=vctObj.get(0).getAcName() %>');"><%=tempString1%></td>
	   		<%
	   		if(vctObj.size()>1){
		   		for(int i=1;i < vctObj.size();i++)
		   		{
		   			Paper objPaper = vctObj.get(i);
		   			String tempString = objPaper.getCadPic(); 
		   			if(tempString!=null && tempString.length()>12)
		   				tempString = "..."+tempString.substring(tempString.length()-12,tempString.length()-4);	
		   			else if(tempString!=null && tempString.length()>4)
		   				tempString =tempString.substring(0,tempString.length()-4);	
		   			%>
		   			 <td background="../images/tab_2.jpg" class="tab2" id="<%="tabLabel"+(i+1)%>"  onclick="clkOn('<%=i+1%>');changePaper('<%=tempString%>','<%=vctObj.get(0).getAcName() %>');"><%=tempString%></td>
		   		<%
		   		}
	   		}
	   	} 
   		 %>    
   		  <td  bgcolor="C6D9EF" style="border-top:1px solid #8FA6BD;">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
</form>
</body>
</html>
<%@ include file="../include/jsp/footer.jsp"%>